<?php
/* @var $this PostController */
/* @var $model Post */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'post-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array(
		'enctype' => 'multipart/form-data'
	)
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'post_category_id'); ?>
		<?php echo $form->dropDownList($model, 'post_category_id', CHtml::listData(PostCategory::model()->findAllByAttributes(array('status' => 1)), 'id', 'title')); ?>
		<?php echo $form->error($model,'post_category_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'thumbnail'); ?>
		<?php echo $form->fileField($model,'thumbnail'); ?>
		<?php echo $form->error($model,'thumbnail'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'quote'); ?>
		<?php echo $form->textArea($model,'quote',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'quote'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'quote_post'); ?>
		<?php echo $form->textArea($model,'quote_post',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'quote_post'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php echo $form->textArea($model,'content', array('rows' => 20, 'class' => 'span6', 'id' => 'main-content')); ?>
		<?php $this->widget('ext.ckeditor.CKEditor', array('selector' => 'main-content'));?>
		<?php echo $form->error($model,'content'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->dropDownList($model,'status', array(0 => Yii::t('app', 'unPublic'), 1 => Yii::t('app', 'public'))); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'is_feature'); ?>
		<?php echo $form->dropDownList($model,'is_feature', array(0 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes'))); ?>
		<?php echo $form->error($model,'is_feature'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sorter_category'); ?>
		<?php echo $form->textField($model,'sorter_category'); ?>
		<?php echo $form->error($model,'sorter_category'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'desc'); ?>
		<?php echo $form->textArea($model,'desc',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'desc'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'seo_link'); ?>
		<?php echo $form->textArea($model,'seo_link',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'seo_link'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'seo_keyword'); ?>
		<?php echo $form->textArea($model,'seo_keyword',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'seo_keyword'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'seo_description'); ?>
		<?php echo $form->textArea($model,'seo_description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'seo_description'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->